<template>
  <homehotcoms title="人气推荐" futitle="人气爆款 不容错过">
    <template #right>
      <more></more>
    </template>
    <template #default>
      <ul class="goods-list">
        <li class="hover-shadow" v-for="item in Hotlist" :key="item.id">
          <router-link to="/">
            <img :src="item.picture" alt="" />
            <p class="name">{{ item.alt }}</p>
            <p class="desc">{{ item.title }}</p>
          </router-link>
        </li>
      </ul>
    </template>
  </homehotcoms>
</template>

<script setup>
import { ref } from 'vue'
import { findhotpeoples } from '@/api/home.js'
import homehotcoms from './homehotcoms.vue'
const Hotlist = ref([])
const Hotshop = async () => {
  const { result } = await findhotpeoples()
  Hotlist.value = result
  // console.log(result)
}
Hotshop()
</script>

<style lang="scss" scoped>
.goods-list {
  display: flex;
  justify-content: space-between;
  height: 426px;
  li {
    width: 306px;
    height: 406px;
    img {
      width: 306px;
      height: 306px;
    }
    p {
      font-size: 22px;
      padding-top: 12px;
      text-align: center;
    }
    .desc {
      color: #999;
      font-size: 18px;
    }
  }
}

// 查看更多样式
.more {
  margin-bottom: 2px;
  span {
    font-size: 16px;
    vertical-align: middle;
    margin-right: 4px;
    color: #999;
  }
  i {
    font-size: 14px;
    vertical-align: middle;
    position: relative;
    top: 2px;
    color: #ccc;
  }
  &:hover {
    span,
    i {
      color: $xtxColor;
    }
  }
}

// panel 面板样式
.home-panel {
  background-color: #fff;
  .head {
    padding: 40px 0;
    display: flex;
    align-items: flex-end;
    h3 {
      flex: 1;
      font-size: 32px;
      font-weight: normal;
      margin-left: 6px;
      height: 35px;
      line-height: 35px;
      span {
        font-size: 16px;
        color: #999;
        margin-left: 20px;
      }
    }
  }
}
// 人气爆款样式结束
</style>
